# -*- coding: utf-8 -*-
"""
Created on Sat May  2 13:54:09 2020

@author: 86150
"""
import os
import os.path as op

iPathSize = 0
strMyPath = "C://Windows//Help"


def my_pathSize(strAbsPath):
    # To calculate the size of a path
    if not op.exists(strAbsPath):
        return 0
    
    if op.isfile(strAbsPath):
        return op.getsize(strAbsPath)
    else:
        dirs = os.listdir( strAbsPath )
        idirSize = 0
        for file in dirs:
            filePath = op.join(strAbsPath, file)
            idirSize += my_pathSize(filePath)
        return idirSize
 

print("The Size of '{}' is: {} bytes.".format(strMyPath, my_pathSize(strMyPath)))       